home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Herra / TIMWIN.ZIP / LOCS.CMD < prev    next >
OS/2 REXX Batch file  |  1993-09-22  |  1KB  |  33 lines

  1. ;LOCS  --                                                RJE 10-9-88
  2. ;           local contrast stretching by producing minimum of maximum of image
  3. ;           and maximum of minimum of image. The latter is subtracted from
  4. ;           the first, and this information is used to scale the original.
  5. ;expects:   image in a
  6. ;result:    image in p or h, depending on configuration
  7. ;uses:      images p, q, r
  8. ;parameter: window size  (default: 11). Should be larger than largest single
  9. ;           structure in the image
  10. ;****************************************************************************
  11. parms
  12. int wsize = 11
  13. endparms
  14. IMAGE img
  15.  
  16. print "windowsize =" wsize
  17.  
  18. if (((improp fg) & DIS_BIT) == DIS_BIT)
  19.   img = "p"
  20. else
  21.   img = "h"
  22. endif
  23.  
  24. dis img
  25. min a wsize         ;produce minimum of original
  26. max wsize  >r       ;maximum of previous to shrink max. fields
  27. max a wsize         ;produce maximum of original
  28. min wsize           ;maximum of prev. to shrink min. fields
  29. sub img r >q        ;local contrast image,
  30. sub a r             ;subtract min. from original
  31. div img q 244       ;constant may need adjustment
  32. stop
  33.